<template>
<div class="content">
    <mt-header fixed title="下属单位详情">
              <div slot="left">
    <mt-button icon="back" @click.native="goback()">返回</mt-button>
              </div>
    </mt-header>
    <mt-cell title="名称" :value="result.name" v-show="result.name"></mt-cell>
    <mt-cell title="地址" :value="result.address" v-show="result.address"></mt-cell>
     <mt-cell title="电话" :value="result.phone" v-show="result.phone"></mt-cell>
    <mt-cell title="监管单位类型" :value="supervisor(result.supervisortype)" v-show="result.supervisortype"></mt-cell>
    <mt-cell title="救援力量" :value="result.personelnum" v-show="result.personelnum"></mt-cell>
    <mt-cell title="消防车数目" :value="result.firetrunknum" v-show="result.firetrunknum"></mt-cell>
    <div class="img-div">
        <img :src="result.imageurl"/>
    </div>
    </div>
</template>
<script>
export default {
  data () {
    return {
      result: {
      },
      supervisortype: ['', '总队', '大队', '支队', '中队']
    }
  },
  created () {
    this.mysuperiordetails()
  },
  filters: {

  },
  methods: {
    async mysuperiordetails () {
      const res = await this.$store.dispatch('mysuperiordetails', {
        supervisorid: this.$route.query.supervisorid
      })
      if (res.status === '0') {
        this.result = res.context
      }
    },
    goback () {
      this.$router.go(-1)
    },
    supervisor (type) {
      if (!type) {
        return
      }
      return this.supervisortype[type]
    }
  }

}
</script>
<style lang="less" scoped>
.content{
    padding-top: 40px;
}
.img-div{
    padding: 10px;
    font-size: 18px;
    img{
        width: 100%;
    }
}
</style>
